﻿''' <summary>
''' コンピューターリスト画面のフォームです。
''' </summary>
''' <remarks></remarks>
Public Class ComputerList
  Inherits Page

#Region " イベントハンドラ "
  Private Sub ComputerDataSource_Selected(
    sender As Object, e As ObjectDataSourceStatusEventArgs) Handles ComputerDataSource.Selected

    Me.CountLabel.Text = String.Format("{0} 個のオブジェクト", DirectCast(e.ReturnValue, ICollection).Count)
  End Sub

  Private Sub DataSource_Selecting(
    sender As Object, e As ObjectDataSourceSelectingEventArgs) Handles DetailDataSource.Selecting, GroupDataSource.Selecting

    If Me.ComputerListBox.SelectedIndex = -1 Then
      e.Cancel = True
    End If
  End Sub

  Protected Sub ComputerListBox_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComputerListBox.SelectedIndexChanged
    If Me.ComputerListBox.SelectedIndex >= 0 Then
      Me.GroupButton.OnClientClick = String.Format(
        "showInRoleGroupList('{0}', '{1}')", Me.ComputerListBox.SelectedValue, CategoryType.Computer)
      Me.GroupButton.Enabled = True
      Me.GroupUpdatePanel.Update()
    End If
  End Sub

  Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Response.Redirect("Main.aspx?idx=2")
  End Sub
#End Region
End Class